import React, { Component } from "react";
import appleImg from "../assets/apple.png";
import "../styles/appleItem.scss";

class AppleItem extends Component {
  render() {
    console.log(this.props);

    return (
      <div className="appleItem">
        <div className="apple">
          <img src={appleImg} alt="apple" />
        </div>
        <div className="info">
          <div className="name">红苹果 - {this.props.appleData.id}号</div>
          <div className="weight">{this.props.appleData.weight}克</div>
        </div>
        <div className="btn-div">
          <button onClick={this.props.onClick}> 吃掉 </button>
        </div>
      </div>
    );
  }
}

export default AppleItem;
